using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (biFactory.User().IdPerfil == 0)
            {
                cboCursos.SourceData = "proc_CursoDisponibles ";
            }
            else
            {
                cboCursos.SourceData = "proc_CursoDisponibles " + biFactory.User().IdSede.ToString();
            }
            cboCursos.TipoOrigen = Controles_cboGeneric.TipoSource.Procedure;
            cboCursos.NameId = "IdCurso";
            cboCursos.NameDescript = "CursoDescrip";
            cboCursos.BindCBO();
        }
        ShowAlumnos();
    }
    void ShowAlumnos() {
        Label1.Text = "";
        btnImprimir.Disabled = true;
        if (cboCursos.ValueInt.CompareTo(0)>0)
        {
            DataTable dt = SchoolsBI.Materia.Tabla("proc_buscarAlumnos ''," + cboCursos.Value + "," + biFactory.User().IdSede.ToString());
            foreach(DataRow dr in dt.Rows){
                if(Label1.Text.Length>0)
                    Label1.Text += ",";
                    Label1.Text += dr[0].ToString();
                btnImprimir.Disabled = false;
            }
        }


    }


   
}
